package com.cap.bts.crmdp.dealer.mars.domain;

import java.io.Serializable;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.cap.bts.crmdp.dealer.activation.domain.PackageRedemptionLines;
import com.cap.bts.crmdp.dealer.coupon.domain.Ticket;
import com.cap.bts.crmdp.dealer.coupon.domain.TicketLine;
import com.cap.bts.crmdp.dealer.purchase.domain.MemberPackageInfo;
import com.cap.bts.crmdp.dealer.redemption.domain.MemberPackageRedemption;
import com.cap.bts.framework.common.domain.BaseDomain;

/**
 * The persistent class for the tm_member_package_redemption database table.
 * 
 */
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@Entity
@Table(name = "tm_raw_package_redemption_lines_item")
@AttributeOverrides({
        @AttributeOverride(name = "createBy", column = @Column(name = "CREATE_BY")),
        @AttributeOverride(name = "createDate", column = @Column(name = "CREATE_DATE", nullable = false)),
        @AttributeOverride(name = "lastUpdateBy", column = @Column(name = "LAST_UPDATE_BY")),
        @AttributeOverride(name = "lastUpdateDate", column = @Column(name = "LAST_UPDATE_DATE")) })
public class PackageRedemptionLinesItem extends BaseDomain implements Serializable {

    private static final long serialVersionUID = 6441972827279522682L;

    private Long id;

    private MemberPackageInfo memberPackageInfo;

    private MemberPackageRedemption memberPackageRedemption;

    private PackageRedemptionLines packageRedemptionLine;

    private Ticket ticket;

    private TicketLine ticketLine;

    private Double price;

    private String itemName;

    private Integer quantity;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @ManyToOne(optional = true, targetEntity = MemberPackageRedemption.class)
    @JoinColumn(name = "REDEEM_ID", referencedColumnName = "ID")
    public MemberPackageRedemption getMemberPackageRedemption() {
        return memberPackageRedemption;
    }

    public void setMemberPackageRedemption(MemberPackageRedemption memberPackageRedemption) {
        this.memberPackageRedemption = memberPackageRedemption;
    }

    @ManyToOne(optional = true, targetEntity = PackageRedemptionLines.class)
    @JoinColumn(name = "REDEEM_LINE_ID", referencedColumnName = "ID")
    public PackageRedemptionLines getPackageRedemptionLine() {
        return packageRedemptionLine;
    }

    public void setPackageRedemptionLine(PackageRedemptionLines packageRedemptionLine) {
        this.packageRedemptionLine = packageRedemptionLine;
    }

    @ManyToOne(optional = true, targetEntity = MemberPackageInfo.class)
    @JoinColumn(name = "PACKAGE_ID", referencedColumnName = "ID")
    public MemberPackageInfo getMemberPackageInfo() {
        return memberPackageInfo;
    }

    public void setMemberPackageInfo(MemberPackageInfo memberPackageInfo) {
        this.memberPackageInfo = memberPackageInfo;
    }

    @ManyToOne(optional = true, targetEntity = Ticket.class)
    @JoinColumn(name = "TICKET_DEF_ID", referencedColumnName = "ID")
    public Ticket getTicket() {
        return ticket;
    }

    public void setTicket(Ticket ticket) {
        this.ticket = ticket;
    }

    @ManyToOne(optional = true, targetEntity = TicketLine.class)
    @JoinColumn(name = "TICKET_LINE_ID", referencedColumnName = "ID")
    public TicketLine getTicketLine() {
        return ticketLine;
    }

    public void setTicketLine(TicketLine ticketLine) {
        this.ticketLine = ticketLine;
    }

    @Column(name = "ITEM_NAME")
    public String getItemName() {
        return itemName;
    }

    public void setItemName(String itemName) {
        this.itemName = itemName;
    }

    @Column(name = "PRICE")
    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    @Column(name = "QUANTITY")
    public Integer getQuantity() {
        return quantity;
    }

    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }

}
